const express = require('express');
const marker = require('../module/marker/marker');
const router = express.Router();

router.post('/addMarker',async(req,res) => {
  const loginStatus = await global.tokenFun.checkToken(req)
  if (loginStatus.loginStatus) {
    const data = await marker.addMarker({
      ...loginStatus.loginRows,
      ...req.body
    })
    res.json(data)
  }else {
    res.json(loginStatus.msg)
  }
})

router.get('/getMarkerListByLineId', async (req,res) => {
  const data = {}
  res.json(data)
})

router.delete('/delMarker', async (req, res) => {
  const data = await marker.delMarker(req.params.id)
  res.json(data)
})

module.exports = router;
